<!DOCTYPE html>
<!--

patch.html

open thought patches, keeping query string

Copyright (C) 2009, Chris Allert, All rights reserved.

This program is free software; you can redistribute it and/or modify it under 
the terms of the GNU General Public License as published by the Free Software 
Foundation; either version 3 of the License, or (at your option) any later 
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY 
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with 
this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
Place, Suite 330, Boston, MA 02111-1307 USA

The latest version of this file can be downloaded from
http://thought-patches.sourceforge.net/

-->
<html>
	<head>
		<title>though patch</title>
<link rel="apple-touch-icon" href="../../thought-patches.png">
<meta content="width=device-width; initial-scale=1.0;  maximum-scale=1.0; user-scalable=0;" name="viewport" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<style>
	body { padding:0px; margin:0px; color: white; background-color: black; font-size: 16px }
</style>
		<script src="../../lib/query.js"></script>
		<script src="../../lib/short.js"></script>
		<script>
			var share_url;
			var p;
			function init() {
				var message = document.getElementById('message');
				var patch = document.getElementById('patch');
				query_init();
				var u;
				if (null == query['patch']) {
					query = unpack_patch(query['s'][0]);
					u = ('' + document.location).split('?')[0];
					p = query['patch'][0];
					u = u.replace('patch/patch.html', 
					p + '/' + p + '.html?');
					var a = [];
					for (var i in query) {
						if (
						('patch' != i) &&
						(null != query[i]) &&
						(null != query[i][0])
						) { a.push(escape(i) + 
						'=' + escape(query[i][0])
						);}
					}
					u += a.join('&');
				} else {
					p = query['patch'][0];
					var u = "" + document.location;
					u = u.replace('patch/patch.html', 
					p + '/' + p + '.html');
				}
				document.location = u;
			}

		</script>
	</head>
	<body onLoad="init()"></body>
</html>

